package org.red_cross_service.controller;

import org.red_cross_service.common.anno.NoNeedToken;
import org.red_cross_service.common.response.Response;
import org.red_cross_service.domain.entity.PlatformEntity;
import org.red_cross_service.service.PlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/platform")
@CrossOrigin
public class PlatformController {

    @Autowired
    private PlatformService platformService;

    @NoNeedToken
    @RequestMapping("/list")
    public Response getList(@RequestBody PlatformEntity platformEntity){
        return platformService.getList(platformEntity);
    }

    @NoNeedToken
    @RequestMapping("/add")
    public Response add(@RequestBody PlatformEntity platformEntity){
        return platformService.add(platformEntity);
    }

    @NoNeedToken
    @RequestMapping("/update")
    public Response update(@RequestBody PlatformEntity platformEntity){
        return platformService.update(platformEntity);
    }
    @NoNeedToken
    @RequestMapping("/delete")
    public Response delete(Integer id){
        return platformService.delete(id);
    }

    @NoNeedToken
    @RequestMapping("/selectOne")
    public Response selectOne(@RequestBody PlatformEntity platformEntity){
        return platformService.selectOne(platformEntity);
    }



}
